package mws;

import java.util.concurrent.ThreadFactory;

public class NameThreadFactory implements ThreadFactory {
    @Override
    public Thread newThread(Runnable r) {
        RunnableWrapper runnableWrapper = new RunnableWrapper(r);

        Thread thread = new Thread(runnableWrapper);
        thread.setName("NameThreadFactory-" + thread.getId());

        return thread;
    }
}
